object DtMBalcao: TDtMBalcao
  OldCreateOrder = False
  Left = 367
  Top = 333
  Height = 406
  Width = 415
  object SQLC_Balcao_Produtos: TSQLClientDataSet
    CommandText = 
      'select * from BALCAO_PRODUTOS where BAI_IDFDOC=:idfdoc order by ' +
      'bai_seqitem; '
    Aggregates = <>
    Options = [poAllowMultiRecordUpdates, poAllowCommandText]
    ObjectView = True
    Params = <
      item
        DataType = ftString
        Name = 'idfdoc'
        ParamType = ptInput
      end>
    DBConnection = DtmGeral.ConexaoBanco
    Left = 200
    Top = 45
    object SQLC_Balcao_ProdutosDescricao: TStringField
      FieldKind = fkInternalCalc
      FieldName = 'Descricao'
      Size = 40
    end
    object SQLC_Balcao_ProdutosCodigo: TStringField
      FieldKind = fkInternalCalc
      FieldName = 'Codigo'
    end
    object SQLC_Balcao_ProdutosTotal: TFloatField
      FieldKind = fkInternalCalc
      FieldName = 'Total'
      DisplayFormat = '###,###,##0.00'
      EditFormat = '###,###,##0.00'
    end
    object SQLC_Balcao_ProdutosDescontoMax: TFloatField
      FieldKind = fkInternalCalc
      FieldName = 'DescontoMax'
    end
    object SQLC_Balcao_ProdutosBAI_IDFDOC: TIntegerField
      FieldName = 'BAI_IDFDOC'
      ProviderFlags = [pfInWhere, pfInKey]
      Required = True
    end
    object SQLC_Balcao_ProdutosBAI_SEQITEM: TSmallintField
      FieldName = 'BAI_SEQITEM'
      ProviderFlags = [pfInWhere, pfInKey]
      Required = True
    end
    object SQLC_Balcao_ProdutosBAI_IDFITEM: TIntegerField
      FieldName = 'BAI_IDFITEM'
      ProviderFlags = [pfInWhere, pfInKey]
      Required = True
    end
    object SQLC_Balcao_ProdutosBAI_PRETAB: TFMTBCDField
      FieldName = 'BAI_PRETAB'
      Required = True
      DisplayFormat = ',0.00'
      EditFormat = '0.00'
      Precision = 15
      Size = 3
    end
    object SQLC_Balcao_ProdutosBAI_PREVEN: TFMTBCDField
      FieldName = 'BAI_PREVEN'
      Required = True
      DisplayFormat = ',0.00'
      EditFormat = '0.00'
      Precision = 15
      Size = 3
    end
    object SQLC_Balcao_ProdutosBAI_QUANTI: TFMTBCDField
      FieldName = 'BAI_QUANTI'
      Required = True
      Precision = 15
      Size = 3
    end
    object SQLC_Balcao_ProdutosBAI_PROSER: TStringField
      FieldName = 'BAI_PROSER'
      Required = True
      Size = 1
    end
    object SQLC_Balcao_ProdutosBAI_SERIAL: TStringField
      FieldName = 'BAI_SERIAL'
    end
    object SQLC_Balcao_ProdutosBAI_IDFHISTORICO: TStringField
      FieldName = 'BAI_IDFHISTORICO'
      Size = 3
    end
    object SQLC_Balcao_ProdutosBAI_TIPPCO: TStringField
      FieldName = 'BAI_TIPPCO'
      Required = True
      Size = 1
    end
  end
  object SQLC_Balcao_Documento: TSQLClientDataSet
    CommandText = 'select * from BALCAO_DOCUMENTO where BAD_IDFDOCUMENTO=:idf;'#13#10
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <
      item
        DataType = ftString
        Name = 'idf'
        ParamType = ptInput
      end>
    DBConnection = DtmGeral.ConexaoBanco
    Left = 64
    Top = 9
    object SQLC_Balcao_DocumentoBAD_IDFDOCUMENTO: TIntegerField
      FieldName = 'BAD_IDFDOCUMENTO'
      Required = True
    end
    object SQLC_Balcao_DocumentoBAD_DATAVE: TDateField
      FieldName = 'BAD_DATAVE'
      Required = True
    end
    object SQLC_Balcao_DocumentoBAD_IDFEMPRESA: TSmallintField
      FieldName = 'BAD_IDFEMPRESA'
      Required = True
    end
    object SQLC_Balcao_DocumentoBAD_CODVEN: TStringField
      FieldName = 'BAD_CODVEN'
      Required = True
      Size = 3
    end
    object SQLC_Balcao_DocumentoBAD_KM: TIntegerField
      FieldName = 'BAD_KM'
    end
    object SQLC_Balcao_DocumentoBAD_PLACAVEICULO: TStringField
      FieldName = 'BAD_PLACAVEICULO'
      Size = 8
    end
    object SQLC_Balcao_DocumentoBAD_IDFPESSOA: TIntegerField
      FieldName = 'BAD_IDFPESSOA'
      Required = True
    end
    object SQLC_Balcao_DocumentoBAD_CODCLI: TIntegerField
      FieldName = 'BAD_CODCLI'
    end
    object SQLC_Balcao_DocumentoBAD_OBSERVA: TMemoField
      FieldName = 'BAD_OBSERVA'
      BlobType = ftMemo
      Size = 1
    end
    object SQLC_Balcao_DocumentoBAD_BAIXADO: TStringField
      FieldName = 'BAD_BAIXADO'
      Required = True
      Size = 1
    end
    object SQLC_Balcao_DocumentoBAD_OPERACAO: TStringField
      FieldName = 'BAD_OPERACAO'
      Required = True
      FixedChar = True
      Size = 1
    end
  end
  object SQLC_ConsultaPedidos: TSQLClientDataSet
    CommandText = 'select *  from BALCAO_DOCUMENTO'
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <>
    AfterOpen = SQLC_ConsultaPedidosAfterOpen
    DBConnection = DtmGeral.ConexaoBanco
    Left = 320
    Top = 6
  end
  object RvPedido: TRvProject
    Engine = RvS_Relatorios
    OnBeforeOpen = RvPedidoBeforeOpen
    OnAfterOpen = RvPedidoAfterOpen
    Left = 96
    Top = 288
  end
  object rdsDocumento: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQLC_Imprimir_Pedido
    Left = 200
    Top = 208
  end
  object rdsProdutos: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQLC_Imprimir_Produtos
    Left = 320
    Top = 192
  end
  object SQLC_Imprimir_Pedido: TSQLClientDataSet
    CommandText = 
      'SELECT BD.BAD_IDFDOCUMENTO, BD.BAD_DATAVE, BD.BAD_CODVEN, USU.US' +
      'U_NOME, EM.EMP_RAZSOC, '#13#10#9'EM.EMP_FANTAS, BAD_IDFPESSOA, EM.EMP_C' +
      'ODPOS, CI.CID_DESCRI, EM.EMP_ESTCOD, EM.EMP_ENDERE,'#13#10#9'EM.EMP_BAI' +
      'RRO, EM.EMP_FONE, EM.EMP_FAX, EM.EMP_CNPJ, EM.EMP_INSEST, BD.BAD' +
      '_OBSERVA,'#13#10#9'PES.PES_IDFCOD, PES.PES_NOME, PES.PES_FANTASIA, PES.' +
      'PES_ENDERECO, PES.PES_BAIRRO, '#13#10#9'PES.PES_POSTAL, CID.CID_DESCRI,' +
      ' CID.CID_ESTCOD, CID.CID_ESTCOD, PES.PES_FONE, PES.PES_CPFCNPJ,'#13 +
      #10'    PES.PES_IDEINS'#13#10#9'FROM BALCAO_DOCUMENTO BD INNER JOIN USUARI' +
      'OS USU ON USU.USU_CODIGO = BD.BAD_CODVEN '#13#10#9'LEFT JOIN EMPRESAS E' +
      'M ON BD.BAD_IDFEMPRESA = EM.EMP_CODIGO'#13#10#9'LEFT JOIN CIDADES CI ON' +
      ' CI.CID_CODIGO = EM.EMP_CIDCOD AND CI.CID_ESTCOD = EM.EMP_ESTCOD' +
      #13#10'                LEFT JOIN PESSOAS PES on PES.PES_IDFCOD = BD.B' +
      'AD_IDFPESSOA '#13#10'                LEFT JOIN CIDADES CID ON CID.CID_' +
      'CODIGO = PES.PES_CIDADE AND CID.CID_ESTCOD = PES.PES_ESTADO'#13#10'WHE' +
      'RE BD.BAD_IDFDOCUMENTO = :DOCUMENTO'
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <
      item
        DataType = ftUnknown
        Name = 'DOCUMENTO'
        ParamType = ptInput
      end>
    DBConnection = DtmGeral.ConexaoBanco
    Left = 104
    Top = 128
  end
  object SQLC_Imprimir_Produtos: TSQLClientDataSet
    CommandText = 
      'SELECT BP.BAI_IDFDOC, EP.ESP_CODIGO, BP.BAI_QUANTI,EP.ESP_DESCRI' +
      ', EP.UNI_CODIGO ,'#13#10' BP.BAI_PREVEN, BP.BAI_PRETAB, (BP.BAI_PREVEN' +
      ' * BP.BAI_QUANTI) AS TOTAL'#13#10'FROM BALCAO_PRODUTOS BP'#13#10'INNER JOIN ' +
      'ESTOQUE_PRODUTO EP ON EP.ESP_IDFCOD = BP.BAI_IDFITEM'#13#10'WHERE BP.B' +
      'AI_PROSER = '#39'P'#39' AND BP.BAI_IDFDOC = :DOCUMENTO1'#13#10'UNION ALL'#13#10'SELE' +
      'CT BP.BAI_IDFDOC, SE.SER_CODIGO, BP.BAI_QUANTI,'#13#10'SE.SER_DESCRI, ' +
      #39'--'#39' , BP.BAI_PREVEN, BP.BAI_PRETAB, '#13#10'(BP.BAI_PREVEN * BP.BAI_Q' +
      'UANTI) AS TOTAL'#13#10'FROM BALCAO_PRODUTOS BP'#13#10'INNER JOIN SERVICOS SE' +
      ' ON SE.SER_IDFSERVICO = BP.BAI_IDFITEM'#13#10'WHERE BP.BAI_PROSER = '#39'S' +
      #39' AND BP.BAI_IDFDOC = :DOCUMENTO2'
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <
      item
        DataType = ftUnknown
        Name = 'DOCUMENTO1'
        ParamType = ptInput
      end
      item
        DataType = ftUnknown
        Name = 'DOCUMENTO2'
        ParamType = ptInput
      end>
    DBConnection = DtmGeral.ConexaoBanco
    Left = 104
    Top = 184
  end
  object RvS_Relatorios: TRvSystem
    TitleSetup = 'Op'#231#245'es de Impress'#227'o'
    TitleStatus = 'Progresso do Relat'#243'rio'
    TitlePreview = 'Marksystte - Visualiza'#231#227'o da Impress'#227'o'
    SystemSetups = [ssAllowCopies, ssAllowCollate, ssAllowDuplex, ssAllowDestPreview, ssAllowDestPrinter, ssAllowDestFile, ssAllowPrinterSetup, ssAllowPreviewSetup]
    SystemFiler.StatusFormat = 'Gerando P'#225'gina %p'
    SystemFiler.StreamMode = smTempFile
    SystemPreview.FormState = wsMaximized
    SystemPreview.MarginMethod = mmScaled
    SystemPreview.MarginPercent = 5.000000000000000000
    SystemPreview.ZoomFactor = 115.000000000000000000
    SystemPrinter.ScaleX = 100.000000000000000000
    SystemPrinter.ScaleY = 100.000000000000000000
    SystemPrinter.StatusFormat = 'Imprimindo p'#225'gina %p'
    SystemPrinter.Title = 'Marksystte'
    SystemPrinter.UnitsFactor = 1.000000000000000000
    Left = 194
    Top = 280
  end
  object SQLC_Imprimir_Pagto: TSQLClientDataSet
    CommandText = 
      'SELECT BAF_VALOR, BAF_CODFORMA, FPG_NOME'#13#10'FROM BALCAO_FORMA'#13#10'INN' +
      'ER JOIN FORMASPAGAMENTO ON FPG_CODIGO=BAF_CODFORMA'#13#10'WHERE BAF_ID' +
      'FDOC=:DOCUMENTO'#13#10'ORDER BY BAF_CODFORMA'
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <
      item
        DataType = ftUnknown
        Name = 'DOCUMENTO'
        ParamType = ptInput
      end>
    DBConnection = DtmGeral.ConexaoBanco
    Left = 104
    Top = 232
    object SQLC_Imprimir_PagtoFPG_NOME: TStringField
      FieldName = 'FPG_NOME'
      Required = True
      Size = 40
    end
    object SQLC_Imprimir_PagtoBAF_VALOR: TFMTBCDField
      FieldName = 'BAF_VALOR'
      Required = True
      Precision = 15
      Size = 2
    end
    object SQLC_Imprimir_PagtoBAF_CODFORMA: TSmallintField
      FieldName = 'BAF_CODFORMA'
      Required = True
    end
  end
  object rdsPagto: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQLC_Imprimir_Pagto
    Left = 328
    Top = 264
  end
end
